<li>
	<div id="custom_attribute_list<?= $this->formGetEditSessionKey() ?>" class="clear relative">
		<? $this->renderPartial('option_list') ?>
	</div>

	<p class="last">
		<a class="imageLink addDocument img_noBottomPading" href="#" onclick="$('custom_attribute_id<?= $this->formGetEditSessionKey() ?>').value = ''; new PopupForm('onLoadCustomAttributeForm', {ajaxFields: $('custom_attribute_list<?= $this->formGetEditSessionKey() ?>').getForm()}); return false;">Add option</a>
		
		<a class="imageLink putDocument img_noBottomPading" href="#" onclick="$('custom_attribute_id<?= $this->formGetEditSessionKey() ?>').value = ''; new PopupForm('onLoadSaveOptionsForm', {ajaxFields: $('custom_attribute_id<?= $this->formGetEditSessionKey() ?>').getForm()}); return false;">Save option set</a>
		
		<a class="imageLink stackDocument img_noBottomPading" href="#" onclick="$('custom_attribute_id<?= $this->formGetEditSessionKey() ?>').value = ''; new PopupForm('onLoadLoadOptionsForm', {ajaxFields: $('custom_attribute_id<?= $this->formGetEditSessionKey() ?>').getForm()}); return false;">Load option set</a>
	</p>
	
	<input type="hidden" name="custom_attribute_id" id="custom_attribute_id<?= $this->formGetEditSessionKey() ?>" value=""/>

	<script type="text/javascript">
		function updateCustomAttributeList(session_key)
		{
			cancelPopup();

			$('custom_attribute_list'+session_key).getForm().sendPhpr(
				'onUpdateCustomAttributeList',
				{
					update: 'custom_attribute_list'+session_key,
					loadIndicator: {
						show: true,
						element: 'custom_attribute_list'+session_key,
						hideOnSuccess: true,
						injectInElement: true,
						src: 'phproad/resources/images/form_load_30x30.gif'
					},
					onSuccess: function(){
						make_options_sortable(session_key);
					}
				}
			)
		}
	</script>
</li>